import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import Vant from 'vant';
import 'vant/lib/index.css';
import "amfe-flexible/index.js"
Vue.use(Vant);

Vue.config.productionTip = false
router.afterEach((to,from,next)=>{
  if(to.meta.title){
  document.title = to.meta.title
  }
 })
 router.beforeEach((to,from,next)=>{
   if(to.meta.login ==true){
     if(localStorage.getItem('islogin')){
       next()
     }else{
       router.push('/login')
     }
   }else{
     next()
   }
 })
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
